package com.wenjunwu.blog.web;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.wenjunwu.blog.entity.SystemResource;
import com.wenjunwu.blog.service.SystemResourceService;

@RestController
public class SystemResourceController {

	@Autowired
	private SystemResourceService systemResourceService;
	
	@RequestMapping(path = {"/resource.json"}, method = RequestMethod.POST)
	public List<SystemResource> getNavigation(@RequestBody String roles) {
		List<SystemResource> systemResources = systemResourceService.findSystemResource(roles);
		return systemResources;
	}
}
